//
// Created by 吴锐 on 2022/2/27.
//

#include "iostream"
#include "fstream"

using namespace std;

class person {
public:
    char name[64];
    int age;
};

void test01(){
    ofstream ofs("person.txt", ios::out | ios::binary);
//    ofs.open("person.txt", ios::out | ios::binary);

    person p = {"张三", 18};
    ofs.write((const char*)&p, sizeof(person));
    ofs.close();
}

int main(){
    test01();
    return 0;
}